<!DOCTYPE html>
<html lang="en">
<head>
    <!--title>TODO supply a title</title-->
    <meta charset="UTF-8">
    <style>
        
    </style>
    <script src="js//jquery.min.js"></script>
    <script src="js/jquery.validate.min.js"></script>
    <script src="js/messages_zh.min.js"></script>
    <script>
    $(document).ready(function(){
        $("#signupForm").validate({
            rules:{
                name:{
                required:true,
                minlength:2
                },
                password:{
                required:true,
                minlength:5
                },
                confirm_password: {
                required:true,
                minlength:5,
                equalTo: "#password"
                }
            },
            messages: {
                name:{
                required:"请输入账号",
                minlength:"至少2个字符"
                },
                password:{
                required:"请输入密码",
                minlength:"至少设置5位密码"
                },
                confirm_password: {
                required:"请重新输入密码",
                minlength:"请与上密码一致",
                equalTo: "请与上密码一致"
                }
            }
        })
    
    
    })
    </script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form class="cmxform" id="signupForm" method="post" action="2reghander.php">
    <fieldset>
        <legend>用户注册</legend>
        <p><label for="name">账号</label>
        <input id="name" name="name" type="text"></P>
        
        <p><label for="password">密码</label>
        <input id="password" name="password" type="password"></P>
        
        <p><label for="confirm_password">再次输入密码</label>
        <input id="confirm_password" name="confirm_password" type="password"></P>
        
        <p><input class="submit" type="submit" value="注册"></P>
    </fieldset>
</form>
</body>
</html>